<template>
  <tr>
    <td>
      <input
        type="checkbox"
        name=""
        id=""
        :checked="item.checked"
        @change="$emit('all', item.name, $event.target.checked)"
      />
    </td>
    <td>{{ item.name }}</td>
    <td>{{ item.price }}</td>
    <td>
      <button @click="$emit('subtract', item.name, item.num - 1)">-</button
      >{{ item.num
      }}<button @click="$emit('add', item.name, item.num + 1)">+</button>
    </td>
    <td>{{ item.price * item.num }}</td>
    <td><button @click="$emit('del', item.name)">删除</button></td>
  </tr>
</template>

<script>
export default {
  name: "MyShop",
  components: {},
  props: {
    item: Object,
    index: Number,
  },
  data() {
    return {};
  },
  computed: {},
  watch: {},
  created() {},
  methods: {},
};
</script>

<style scoped></style>
